<me:UITSTVKP x:Class="WPFExcelReport.TUBTVKP"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
    xmlns:UserControls="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Controls"
    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
    xmlns:VK="clr-namespace:WPFExcelReport;assembly=TVKKOPF"
    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"
    xmlns:DR="clr-namespace:WPFExcelReport;assembly=TDRAUFTR" 
    xmlns:KD="clr-namespace:WPFExcelReport;assembly=TKDSTAMM" 
    xmlns:WD="clr-namespace:WPFExcelReport;assembly=TWDECK"
    xmlns:WG="clr-namespace:WPFExcelReport;assembly=TWGBST"
    xmlns:VA="clr-namespace:WPFExcelReport;assembly=TVAART" 
    xmlns:VF="clr-namespace:WPFExcelReport;assembly=TVAFARBEN" 
    xmlns:WFW="clr-namespace:WPFExcelReport;assembly=TICC_WFEVENTS"
    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
    xmlns:ZB="clr-namespace:WPFExcelReport;assembly=TVKZUAB"  
    xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT"
    xmlns:VKD="clr-namespace:WPFExcelReport;assembly=TVKADR"   
    xmlns:VRP="clr-namespace:WPFExcelReport;assembly=TVRPOS"   
     xmlns:me="clr-namespace:WPFExcelReport"  
    xmlns:TXT="clr-namespace:WPFExcelReport;assembly=TTXTIND"  
    xmlns:TK="clr-namespace:WPFExcelReport;assembly=TTXTKON"                                                            
    FontSize="14" 
    x:Name="TV"
    Loaded="Window_Loaded"
 >
    <me:UITSTVKP.Resources>
        <CollectionViewSource   x:Key="vwMaster" />
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:NOTBoolToVisibilityConverter  x:Key="nbv"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:Divideby10000 x:Key="dw"/>
        <ucd:BM2YD x:Key="BM2YD"/>
        <ucd:NOTConverter  x:Key="not"/>
        <ucd:PNumConverter x:Key="pnum"/>
        <ucd:TextTrimmingConverter  x:Key="trim"/>
        <ucd:PreisConverter  x:Key="price"/>
        <ucd:SDKEYCONV x:Key="sd"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
    </me:UITSTVKP.Resources>
    <Grid >
        <Grid.RowDefinitions>
            <RowDefinition   Height="Auto" />
            <RowDefinition   Height="Auto" />
            <RowDefinition   Height="1*" />
            <RowDefinition   Height="Auto" />
            <RowDefinition   Height="Auto" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition  Width="1*" />
            <ColumnDefinition  Width="1*" />
            <ColumnDefinition  Width="300" />
        </Grid.ColumnDefinitions>
        <StackPanel  Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" IsEnabled="{Binding IsInactive,ElementName=TV,Converter={StaticResource not}}">
            <WrapPanel  Margin="5,5,0,0" VerticalAlignment="Top">
                <Grid VerticalAlignment="Top" IsEnabled="{Binding IsCanNew,ElementName=TV}" Visibility="Collapsed">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button Grid.Column="0" Height="20"  Width="24" Margin="0,0,0,0"   Click="NewCommand" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Add.png" />
                        </Button.Background>
                    </Button>
                </Grid>
                <Grid Margin="10,0,0,0" VerticalAlignment="Top" IsEnabled="{Binding IsCanDelete,ElementName=TV}" Visibility="Collapsed">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button Click="DeleteCommand" Height="20" Margin="5,0,0,0" Width="24" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Remove.png" />
                        </Button.Background>
                    </Button>
                </Grid>
                <Grid Margin="10,0,0,0" VerticalAlignment="Top" IsEnabled="{Binding IsCanInactive,ElementName=TV}" >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button Click="InactiveCommand" Height="20" Margin="5,0,0,0" Width="24" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/split.png" />
                        </Button.Background>
                    </Button>
                </Grid>
                <Grid Margin="10,0,0,0" VerticalAlignment="Top" IsEnabled="{Binding IsCanCopy,ElementName=TV}">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button    Click="CopyCommand" Height="20" Margin="5,0,0,0" Width="24" Visibility="Collapsed">
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/copy.png" />
                        </Button.Background>
                    </Button>
                </Grid>
                <WrapPanel Margin="10,0,0,0"  Visibility="Collapsed">
                    <VKD:VKKAD03 
                        ORDERNUM="{Binding AUF,ElementName=TV}"  
                                 IsEdit="True"  
                                 IsAuto="True"
                                 VerticalAlignment="Top" 
                                 />
                    <CheckBox Margin="10,0,0,0" Content="{Binding Source={Localization:Translate Word=品种信息}}" 
                              IsChecked="{Binding IsShowBottom,ElementName=TV,Mode=OneWayToSource}"/>
                    <CheckBox Margin="10,0,0,0"  Content="{Binding Source={Localization:Translate Word=发票}}" 
                              IsChecked="{Binding IsShowRight,ElementName=TV,Mode=OneWayToSource}"/>
                </WrapPanel>
                <Grid Margin="10,0,0,0" VerticalAlignment="Top">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=订单行:}}"   Margin="0,0,0,0"></TextBlock>
                    <TextBlock Grid.Column="1"   
                                   Text="{Binding VKPAUFPOS,Source={StaticResource vwMaster}}" 
                                   Width="30" />
                </Grid>
                <Grid Margin="10,0,0,0" VerticalAlignment="Top">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="auto"></ColumnDefinition>
                        <ColumnDefinition Width="auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=行类型:}}"/>
                    <SD:TSSD0253  Grid.Column="1" 
                                  IsEdit="{Binding IsEdit,ElementName=TV}"
                                  KEY="{Binding POSTYP,ElementName=TV}" 
                                   />
                    <TextBlock Grid.Column="2"  Text="{Binding VKPPOSTYP}" Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource nbv}}"/>
                </Grid>
                <Grid Margin="10,0,0,0" VerticalAlignment="Top">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>

                    <Button  Grid.Column="1"   Click="btnPrint_Click" Height="20" Margin="5,0,0,0" 
                             Width="Auto" Content="{Binding Source={Localization:Translate Word=投产通知单}}" />
                </Grid>
                <WrapPanel>
                    <Grid Margin="10,0,0,0" VerticalAlignment="Top" Visibility="Collapsed">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=状态}}"/>
                        <SD:K14SA Grid.Column="2"   IsEdit="False"
                                   EXAUF="{Binding BSTSTA,ElementName=TV}" 
                                  />
                    </Grid>
                    <Grid Margin="10,0,0,0" >
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=内包装:}}"/>
                        <SD:TSSD0114 Grid.Column="1"  Name="IP"
                                     KEY="{Binding VKPAUFMART,ElementName=TV}"  
                                     Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource bv}}"
                                     IsEdit="{Binding IsEdit,ElementName=TV}" Width="100" />
                        <TextBlock Grid.Column="1" Text="{Binding VKPAUFMART,ElementName=TV,Converter={StaticResource sd},ConverterParameter=0114}"
                                   Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource nbv}}"
                                   Width="100"/>
                    </Grid>
                    <Grid Margin="10,0,0,0" >
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=外包装:}}"/>
                        <SD:TSSD0209 Grid.Column="1" Name="OP"
                                     Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource bv}}"
                                     KEY="{Binding VKPVERPART,ElementName=TV}"  
                                     IsEdit="{Binding IsEdit,ElementName=TV}"/>
                        <TextBlock Grid.Column="1" Text="{Binding VKPVERPART,ElementName=TV,Converter={StaticResource sd},ConverterParameter=0209}" 
                                   Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource nbv}}"
                                   Width="200"/>
                    </Grid>
                </WrapPanel>
                <Grid Margin="10,0,0,0" VerticalAlignment="Top" Visibility="Collapsed">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>

                    <Button  Grid.Column="0"   Click="btnPrintCN_Click" Height="auto" Margin="5,0,0,0" 
                             Width="Auto" Content="{Binding Source={Localization:Translate Word=合同(内销)}}" />
                    <Button  Grid.Column="1"   Click="btnPrintEN_Click" Height="auto" Margin="5,0,0,0" 
                             Width="Auto" Content="{Binding Source={Localization:Translate Word=合同(外销)}}" />
                </Grid>
            </WrapPanel>

        </StackPanel>
        <StackPanel Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" IsEnabled="{Binding IsInactive,ElementName=TV,Converter={StaticResource not}}">
            <WrapPanel   Margin="5,5,0,0" VerticalAlignment="Top" >
                <WrapPanel>
                    <TextBlock    Text="{Binding Source={Localization:Translate Word=交期:}}"/>
                    <ex:TXT72  Text="{Binding VKPLIEFTERM}" 
                                       IsReadOnly="{Binding IsEdit,Converter={StaticResource not}}" KeyUp="KD_KeyUp"  TabIndex="502"  Width="120"/>
                    <TextBlock Text="{Binding Source={Localization:Translate Word=合同编号}}"/>
                    <ex:TXT72 Text="{Binding VKPKDKOMM}" MaxLength="15" 
                          Width="100"
                          IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}"/>
                </WrapPanel>
                <Grid >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=客户品种:}}"/>
                    <ex:TXT72 Grid.Column="1" MaxLength="24" Text="{Binding VKPKDARTNR, Converter={StaticResource ResourceKey=gb2312}}" Width="150"  VerticalAlignment="Top"/>
                </Grid>
                <Grid >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=色号:}}"/>
                    <ex:TXT72 Grid.Column="1" MaxLength="10" Text="{Binding VKPKDFARBNR, Converter={StaticResource ResourceKey=gb2312}}" Width="100"/>
                </Grid>
                <Grid >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=描述:}}"/>
                    <ex:TXT72 Grid.Column="1" MaxLength="30" Text="{Binding VKPKDBEZ, Converter={StaticResource ResourceKey=gb2312}}" Width="200"/>
                </Grid>
            </WrapPanel>
        </StackPanel>
        <Grid Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Margin="5,0,0,0"  >
            <Grid.RowDefinitions>
                <RowDefinition   Height="Auto" />
                <RowDefinition   Height="1*" />
                <RowDefinition   Height="Auto" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="1*"></ColumnDefinition>
                <ColumnDefinition Width="400"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <StackPanel  Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" 
                         IsEnabled="{Binding IsInactive,ElementName=TV,Converter={StaticResource not}}">
                <WrapPanel Margin="0,5,0,0">
                    <VF:TLSVA10 Name="cVA10" ARTST="{Binding ARTST,ElementName=TV}"
                             Visibility="{Binding IsCheckVA,ElementName=TV,Converter={StaticResource bv}}"
                             IsEdit="{Binding IsEdit,ElementName=TV}"
                             dwVF="{Binding dwVF,ElementName=TV}"    
                            Width="Auto"/>
                    <VF:TNOVA10  dwVF="{Binding Path=dwVF,ElementName=TV}"  
                                 Visibility="{Binding IsCheckVA,ElementName=TV,Converter={StaticResource nbv}}"
                                ARTST="{Binding ARTST,ElementName=TV}"
                                IsNew="{Binding IsCheckVA,ElementName=TV,Converter={StaticResource not}}"
                                ORDERNUM="{Binding VART,ElementName=TV}"                                 
                                Name="cNOVA"/>
                    <CheckBox Visibility="Collapsed" Grid.Column="0" Content="{Binding Source={Localization:Translate Word=检查品种}}" IsChecked="{Binding IsCheckVA,ElementName=TV}"/>
                    <WrapPanel Margin="10,0,0,0">
                        <Grid >
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <TextBlock Grid.Column="0"  Text="{Binding Source={Localization:Translate Word=单价:}}"/>
                            <ex:NumericBox  DecimalPlaces="2" Grid.Column="1" 
                                       Name="txtPrice" 
                                       Text="{Binding VKPPREIS,Converter={StaticResource price},Source={StaticResource vwMaster}}" 
                                   IsReadOnly="{Binding IsEdit,Converter={StaticResource not}}"   Width="80"/>
                        </Grid>
                        <Grid Margin="10,0,0,0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <TextBlock Grid.Column="0"  Text="{Binding Source={Localization:Translate Word=单位:}}"/>
                            <SD:TSSD0181 Grid.Column="1" 
                                     LMS="{Binding UMLMS,ElementName=TV}"
                                     KEY="{Binding MEEH,ElementName=TV}" 
                                     EXAUF="{Binding MEEH,ElementName=TV}" 
                                     dwKEY="{Binding dwMEEH,ElementName=TV}" 
                                     IsEdit="{Binding IsEdit,ElementName=TV}" />
                        </Grid>
                        <TextBlock Grid.Column="0"  Text="{Binding Source={Localization:Translate Word=公差:}}"/>
                        <ex:TXT72 Grid.Column="1" MaxLength="30" Text="{Binding OVERSHORT,ElementName=TV,Converter={StaticResource gb2312}}" 
                                   IsReadOnly="{Binding IsEdit,Converter={StaticResource not}}"   Width="100"/>
                        <TextBlock Grid.Column="2"  Text="{Binding Source={Localization:Translate Word=匹数:}}"/>
                        <ex:TXT72 MaxLength="5" Grid.Column="3" Text="{Binding PCS,ElementName=TV}" 
                                     IsReadOnly="{Binding IsEdit,Converter={StaticResource not}}" Width="40"/>
                        <TextBlock Grid.Column="4" FontSize="16" Text="{Binding Source={Localization:Translate Word=数量:}}"/>
                        <TextBox Name="txtQty" Grid.Row="1" Grid.Column="5"   Width="80"  IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}" TabIndex="502"  KeyUp="QTY_KeyUp"  >
                            <TextBox.Text>
                                <Binding Path="VKPMENGE1"   Converter="{StaticResource d100}">
                                    <Binding.ValidationRules>
                                        <ucd:NumberRangeRule  Max="999999" />
                                    </Binding.ValidationRules>
                                </Binding>
                            </TextBox.Text>
                        </TextBox>
                        <WrapPanel Margin="10,0,0,0" >

                            <TextBlock Grid.Column="2"   Text="{Binding Source={Localization:Translate Word=M}}" Width="24"/>
                            <TextBox   Grid.Row="1" Grid.Column="1"   Width="80"  IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}" TabIndex="502"  KeyUp="QTY_KeyUp"  >
                                <TextBox.Text>
                                    <Binding Path="VKPMENGE1"   Converter="{StaticResource BM2YD}">
                                        <Binding.ValidationRules>
                                            <ucd:NumberRangeRule  Max="999999" />
                                        </Binding.ValidationRules>
                                    </Binding>
                                </TextBox.Text>
                            </TextBox>
                            <TextBlock Grid.Column="2"   Text="{Binding Source={Localization:Translate Word=YD}}" Width="24"/>
                        </WrapPanel>
                    </WrapPanel>

                </WrapPanel>
                <WrapPanel Visibility="{Binding IsBasedOnOF,ElementName=TV,Converter={StaticResource bv}}">
                    <WrapPanel>
                        <TextBlock  Text="{Binding Source={Localization:Translate Word=报价单号:}}"/>
                        <ex:TXT72 Grid.Column="1" MaxLength="2"  PRE="  "  IsAutoClear="True"
                                  Text="{Binding VKPKOAUFKRS}" Width="40"/>
                        <ex:TXT72 Grid.Column="1" MaxLength="6"  PRE="000000"  IsAutoClear="True"
                                  Text="{Binding VKPKOAUFLFD}" Width="80"/>
                        <ex:TXT72 Grid.Column="1" MaxLength="3"  PRE="000"  IsAutoClear="True"
                                  Text="{Binding VKPKOAUFPOS}" Width="60"/>
                        <Button    Click="VRPKOCommand" Height="20" Margin="5,0,0,0" Width="24" >
                            <Button.Background>
                                <ImageBrush  ImageSource="/ImagePackage;component/Images/Refresh.png" />
                            </Button.Background>
                        </Button>
                    </WrapPanel>
                </WrapPanel>
            </StackPanel>
            <DataGrid Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2"
                 AutoGenerateColumns="False" 
                 EnableRowVirtualization="False" 
                 Name="dlgMaster" IsReadOnly="True" 
                 ItemsSource="{Binding Source={StaticResource vwMaster }}" 
                 HeadersVisibility="Column" 
                 CanUserReorderColumns="True"
                 CanUserResizeRows="True" 
                 GridLinesVisibility="All"
                 RowDetailsVisibilityMode="VisibleWhenSelected" 
                 Width="Auto" Height="Auto"
                 EnableColumnVirtualization="True" 
                 HorizontalScrollBarVisibility="Auto" 
                 VerticalScrollBarVisibility="Auto">
                <DataGrid.Columns>
                    <DataGridTextColumn Binding="{Binding Path=VKPSA}" Header="{Binding Source={Localization:Translate Word=有效}}" Width="Auto" MinWidth="30" />
                    <DataGridTextColumn Binding="{Binding Path=VKPAUFPOS,Converter={StaticResource pnum}}" Header="{Binding Source={Localization:Translate Word=行}}" Width="Auto"  />
                    <DataGridTextColumn Binding="{Binding Path=VKPART}" Header="{Binding Source={Localization:Translate Word=面料}}" Width="Auto" MinWidth="30"  />
                    <DataGridTextColumn Binding="{Binding Path=VKPFARBE, Converter={StaticResource ResourceKey=trim}}" Header="{Binding Source={Localization:Translate Word=色号}}" Width="Auto"  />
                    <DataGridTextColumn Binding="{Binding Path=VKPKDARTNR, Converter={StaticResource ResourceKey=trim}}" Header="{Binding Source={Localization:Translate Word=客户品种}}" Width="Auto" MinWidth="30"  />
                    <DataGridTextColumn Binding="{Binding Path=VKPKDFARBNR, Converter={StaticResource ResourceKey=trim}}" Header="{Binding Source={Localization:Translate Word=色号}}" Width="Auto"  />
                    <DataGridTextColumn Binding="{Binding Path=VKPMENGE1, Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=数量}}" Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=VKPPREIS, Converter={StaticResource ResourceKey=price}}" Header="{Binding Source={Localization:Translate Word=单价}}" Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=VKPPOSWERT}" Header="{Binding Source={Localization:Translate Word=本币价值}}" Width="Auto" Visibility="Collapsed"/>
                    <DataGridTextColumn Binding="{Binding Path=BUVALUE}" Header="{Binding Source={Localization:Translate Word=交易价值}}" Width="Auto"  Visibility="Collapsed"/>
                    <DataGridTextColumn Binding="{Binding Path=VKPRESERV, Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=预留}}" Width="Auto"/>
                    <DataGridTextColumn Binding="{Binding Path=VKPZUGET, Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=留位}}" Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=VKPFREIGE, Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=发货}}" Width="Auto"/>
                    <DataGridTextColumn Binding="{Binding Path=VKPVERS, Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=走货}}" Width="Auto"/>
                    <DataGridTextColumn Binding="{Binding Path=VKPLIEFTERM}" Header="{Binding Source={Localization:Translate Word=交期}}" Width="Auto" MinWidth="30" />
                    <DataGridTextColumn Binding="{Binding Path=VKPPOSTYP}" Header="{Binding Source={Localization:Translate Word=行类型}}" Width="Auto" MinWidth="30" />
                    <DataGridTextColumn Binding="{Binding Path=VKPAUFMART}" Header="{Binding Source={Localization:Translate Word=内包装}}" Width="Auto" MinWidth="30"  />
                    <DataGridTextColumn Binding="{Binding Path=VKPAUFMART,Converter={StaticResource sd}, ConverterParameter=0114}"   Width="Auto" MinWidth="30"  />
                    <DataGridTextColumn Binding="{Binding Path=VKPVERPART}" Header="{Binding Source={Localization:Translate Word=外包装}}" Width="Auto" MinWidth="30"  />
                    <DataGridTextColumn Binding="{Binding Path=VKPVERPART,Converter={StaticResource sd}, ConverterParameter=0209}" Width="Auto" MinWidth="30"  />
                    <DataGridTextColumn Binding="{Binding Path=VKPKDBEZ, Converter={StaticResource ResourceKey=trim}}" Header="{Binding Source={Localization:Translate Word=描述}}" Width="Auto"  />
                </DataGrid.Columns>
            </DataGrid>
            <WrapPanel Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2">
                <WrapPanel >
                    <TextBlock Text="{Binding TKEY1}"  Margin="10,0,0,0"></TextBlock>
                    <TextBlock Text="{Binding SUM1,Converter={StaticResource d100}}" Foreground="Red" Margin="10,0,0,0"></TextBlock>
                    <TextBlock Text="{Binding TKEY2}"   Margin="10,0,0,0"></TextBlock>
                    <TextBlock Text="{Binding SUM2}" Foreground="Red" Margin="10,0,0,0"></TextBlock>
                    <TextBlock Text="{Binding TKEY3}"   Margin="10,0,0,0"></TextBlock>
                    <TextBlock Text="{Binding SUM3}" Foreground="Red" Margin="10,0,0,0"></TextBlock>
                    <TextBlock Text="{Binding TCOUNT1}"   Margin="10,0,0,0"></TextBlock>
                    <TextBlock Text="{Binding Counts}" Foreground="Red" Margin="20,0,0,0"></TextBlock>
                </WrapPanel>
                <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=更改}}"/>
                <TextBlock Grid.Column="1"  Text="{Binding VKPAENDBEN}" Width="Auto"/>
                <TextBlock Grid.Column="1"  Text="{Binding VKPAENDDAT}" Width="Auto"/>
                <TextBlock Grid.Column="1"  Text="{Binding VKPNEUBEN}" Width="Auto"/>
                <TextBlock Grid.Column="1"  Text="{Binding VKPSACHBE}" Width="Auto"/>
                <WrapPanel Margin="10,0,0,0">
                    <TextBlock  Text="{Binding Source={Localization:Translate Word=金额:}}"/>
                    <TextBlock  Text="{Binding VKPPOSWERT}" Width="80"/>
                    <TextBlock  Text="{Binding Source={Localization:Translate Word=交易价值:}}"/>
                    <TextBlock  Text="{Binding BUVALUE,Source={StaticResource vwMaster}}" Width="80"/>
                    <TextBlock  Text="{Binding Source={Localization:Translate Word=汇率:}}"/>
                    <TextBlock  Text="{Binding VKPKURS,Converter={StaticResource dw}}" Width="80"/>
                </WrapPanel>
            </WrapPanel>
        </Grid>
        <Grid Grid.Row="0" Grid.RowSpan="3" Grid.Column="2">
            <Grid.RowDefinitions>
                <RowDefinition   Height="1*"/>
                <RowDefinition   Height="1*"/>
            </Grid.RowDefinitions>
            <TabControl Grid.Row="0" >
                <TabItem Header="{Binding Source={Localization:Translate Word=备注}}" Name="ZoneTxt">
                    <StackPanel   Grid.Row="1" Grid.Column="1" Grid.RowSpan="3" 
                                   IsEnabled="{Binding IsInactive,ElementName=TV,Converter={StaticResource not}}">
                        <VF:TVA10 Name="cSVA10" Grid.Column="1" Visibility="Collapsed"
                                   IsCanLoad="{Binding IsSelected,ElementName=ZoneTxt}"
                                  ORDERNUM="{Binding VART,ElementName=TV}"
                                  PRART="{Binding PRART,ElementName=TV}"/>
                        <StackPanel>
                            <WrapPanel>
                                <Button    Click="CopyTXTCommand" Height="20" Margin="5,0,0,0" Width="24" >
                                    <Button.Background>
                                        <ImageBrush  ImageSource="/ImagePackage;component/Images/copy.png" />
                                    </Button.Background>
                                </Button>
                                <CheckBox IsChecked="{Binding IsCopyTxtMode,ElementName=TV}" Content="复制模式"/>
                                <Button   Click="CopyEXTXTCommand" Height="20" Margin="5,0,0,0" Content="{Binding Source={Localization:Translate Word=其他单复制}}" />

                            </WrapPanel>
                            <WrapPanel Visibility="Collapsed">
                                <TXT:TXTTP Grid.Row="0" IsAuto="True"
                               Name="cT"
                              TART="VKT" 
                              SIND="{Binding TXTISIND,ElementName=TV}"  
                              PIND="{Binding PIND,ElementName=TV}"                              
                              VerticalAlignment="Top"/>
                                <TXT:TXTTP Grid.Row="0" IsAuto="True"
                               Name="cTZB"
                              TART="VKT" 
                              SIND="{Binding TXTVKPSIND,ElementName=TV}"  
                              PIND="{Binding VKPPIND,ElementName=TV}"                              
                              VerticalAlignment="Top"/>

                            </WrapPanel>
                            <TK:TPUTVKP Name="cTxt"
                            IsInfoOneLine="True"                                    
                            PIND="{Binding PIND,ElementName=cT}" />
                        </StackPanel>
                        <Expander Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="2" Name="ZoneOffer"
                          IsExpanded="{Binding IsBasedOnOF,ElementName=TV}"
                  Visibility="{Binding IsBasedOnOF,ElementName=TV,Converter={StaticResource bv}}"
                  >
                            <Expander.Header>
                                <WrapPanel>
                                    <TextBlock Text="{Binding Source={Localization:Translate Word=报价单}}"></TextBlock>
                                </WrapPanel>
                            </Expander.Header>
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition   Height="Auto" />
                                    <RowDefinition   Height="Auto" />
                                </Grid.RowDefinitions>
                                <WrapPanel Grid.Row="0" >
                                    <CheckBox IsChecked="{Binding IsTake,ElementName=cVKSZB}" 
                                      Content="{Binding Source={Localization:Translate Word=获取报价}}"/>
                                </WrapPanel>
                                <me:TVKPVAPR   Grid.Row="1"
                                       IsCanLoad="{Binding IsExpanded,ElementName=ZoneOffer}"
                            VKPSA="  "
                        IsAuto="False" 
                        INFO="{Binding INFO,ElementName=TV}"
                        AUF="{Binding VKPKOAUF,ElementName=TV}" />
                            </Grid>
                        </Expander>
                    </StackPanel>
                </TabItem>
                <TabItem Header="{Binding Source={Localization:Translate Word=质量要求}}">
                    <TK:TPUTVKPQUALITY Name="cTxtQ"
                            IsInfoOneLine="True"      
                           IsEdit="{Binding IsEdit,ElementName=cTxt}" 
                            IsSaved="{Binding IsSaved,ElementName=cTxt}" 
                            PIND="{Binding PIND,ElementName=cT}" />
                </TabItem>
                <TabItem Header="{Binding Source={Localization:Translate Word=备注}}">
                    <TK:TPUTVKPREMARK Name="cTxtR"
                            IsInfoOneLine="True"                                    
                            PIND="{Binding PIND,ElementName=cT}" 
                             IsEdit="{Binding IsEdit,ElementName=cTxt}" 
                             IsSaved="{Binding IsSaved,ElementName=cTxt}" 
                                           />
                </TabItem>
                <TabItem Header="{Binding Source={Localization:Translate Word=其他单复制}}" Name="cTXTTH"  >
                    <me:TSMVKART 
                            Grid.Row="0"
                            IsCanLoad="{Binding IsSelected,ElementName=cTXTTH}"
                            EXAUF="{Binding TXTISIND,ElementName=TV}"
                            PIND="{Binding EXPIND,ElementName=TV}"
                            />
                </TabItem>
            </TabControl>
            <TabControl Grid.Row="1">
                <TabItem Header="织边数量" Name="ZoneZBQ"  >
                    <TK:TPUTZBQTY Name="cZBQTY" Grid.Row="0"                            
                            IsInfoOneLine="True"
                            PIND="{Binding VKPPIND,ElementName=TV}" 
                           QTY="{Binding QTY,ElementName=TV}"/>
                </TabItem>
                <TabItem Header="织边" Name="ZoneZB" >
                    <TK:TPUTZB Name="cZB"  
                            IsInfoOneLine="True" 
                            PIND="{Binding PIND,ElementName=TV}" />
                </TabItem>
            </TabControl>
        </Grid>
        <Expander Grid.Row="3" Grid.Column="0"  IsExpanded="False"
                  Name="ZonePrice"  
                  Visibility="{Binding IsStagePrice,ElementName=TV,Converter={StaticResource bv}}"
                  >
            <Expander.Header>
                <WrapPanel>
                    <TextBlock Text="{Binding Source={Localization:Translate Word=阶段价格}}"></TextBlock>
                </WrapPanel>
            </Expander.Header>
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition   Height="Auto" />
                    <RowDefinition   Height="Auto" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition  Width="Auto" />
                    <ColumnDefinition  Width="Auto" />
                </Grid.ColumnDefinitions>
                <WrapPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2">
                    <CheckBox IsChecked="{Binding IsTake,ElementName=cVKSZB}" Content="{Binding Source={Localization:Translate Word=抓取品种报价}}"/>
                </WrapPanel>
                <ZB:TVAPR IsAuto="False" Grid.Row="1"  Grid.Column="0"
                            IsCanLoad="{Binding IsExpanded,ElementName=ZonePrice}"
                              dwZB="{Binding dwExtZB,ElementName=cVKSZB}" 
                              INFO="{Binding INFO,ElementName=TV}"
                              KRS="VA"
                              VKZSA="VK"  
                              VART="{Binding VART,ElementName=TV}"/>
                <ZB:TVAPR Grid.Row="1" Grid.Column="1" Name="cVKSZB"  
                            IsCanLoad="{Binding IsExpanded,ElementName=ZonePrice}"
                          IsAuto="True" 
                          INFO="{Binding INFO,ElementName=TV}" 
                          VKZSA="VK"  
                          IsEdit="{Binding IsEdit,ElementName=TV}"
                          IsSaved="{Binding IsSaved,ElementName=TV}"
                          ORDERNUM="{Binding KEY,ElementName=TV}"/>

            </Grid>
        </Expander>
    </Grid>
</me:UITSTVKP>
